// 为count生成action对象
import { ADD, NOADD } from '../constant.js'
// 非异步的是对象
export const createAddMsg = data => ({ type: ADD, data })
export const createNoaddMsg = data => ({ type: NOADD, data })
// 异步的action只能是函数
export const createAsyncAddMsg = (data, time) => {
    return (dispatch) => {
        setTimeout(() => {
            dispatch({ type: ADD, data })
        }, time)
    }
}